//
//  BaseViewController.swift
//  AIPhotoProcess
//
//  Created by aw031 on 17/10/2025.
//

import UIKit
import SnapKit

class BaseViewController: UIViewController {
    
    
    var navigationViewBar: BaseNavigationBarView!

    
    lazy var topBackImageView: UIImageView = {
        let imageView = UIImageView()
        imageView.contentMode = .scaleToFill
        imageView.image = KImage("homeTopIcon")
        return imageView
    }()
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        navigationController?.navigationBar.isHidden = true;
        navigationController?.isNavigationBarHidden = true;
    }
    
    
    override func viewDidLoad() {
        super.viewDidLoad()

        view.backgroundColor = .white
        // Do any additional setup after loading the view.
    }
    
    
    
    func addTopImageView() {
        view.addSubview(self.topBackImageView)
        self.topBackImageView.snp.makeConstraints { make in
            make.leading.trailing.top.equalTo(0)
            make.height.equalTo(KScreenWValue(292))
        }
    }
    
    func addNavigationBar(_ type : BaseNavigationBarViewType , clickBlock:EventAndIndexBlock?) {
        navigationViewBar = BaseNavigationBarView(frame: CGRectMake(0, 0, KScreenWidth, KStatusAndNavigationHeight), type: type)
        navigationViewBar.clickTagBlock = clickBlock
        view.addSubview(navigationViewBar)
        view.bringSubviewToFront(navigationViewBar)
    }
    
    override var preferredStatusBarStyle: UIStatusBarStyle {
        return .darkContent
    }

}
